<@_sysDept id=admin.deptId>
	<#assign dept=object/>
	<#assign containChild=object.ownsAllCategory/>
</@_sysDept>
<@_sysDeptCategory deptId=admin.deptId!'' categoryId=categoryId!><#assign deptCategory=object!/></@_sysDeptCategory>
<#if !dept?has_content||(!dept.ownsAllCategory&&!deptCategory?has_content)>
	<#assign error='verify.notEquals.siteId'/>
	<#include "../common/ajaxError.html"/>
<#else>
	<#if parentId?has_content>
		<@_content id=parentId>
			<#assign parent=object/>
		</@_content>
	</#if>
	<div class="pageHeader">
		<form id="pagerForm" onsubmit="return navTabSearch(this);" method="post">
			<#include "../include_page/paramters.html"/>
			<div class="searchBar">
				<ul class="searchContent two">
					<li class="width:auto">
						<#include "../include_page/status.html"/>
					</li>
					<li>
						<label>发布用户:</label>
						<#include "../include_page/userId.html"/>
					</li>
					<li class="colspan">
						<label>发布日期:</label>
						<input type="text" name="startPublishDate" size="15" class="date" dateFmt="yyyy-MM-dd HH:mm:ss" value="${startPublishDate!}" />
						<span>-</span>
						<input type="text" name="endPublishDate" size="15" class="date" dateFmt="yyyy-MM-dd HH:mm:ss" value="${endPublishDate!}" />
					</li>
					<li>
						<label>标题:</label><input type="text" size="20" name="title" value="${title!}" />
					</li>
					<li style="width:auto">
						<label>模型:</label>
						<#include "../include_page/modelId.html"/>
					</li>
				</ul>
				<div class="subBar">
					<ul>
						<li>
							<div class="buttonActive"><div class="buttonContent"><button type="submit">搜索</button></div></div>
						</li>
					</ul>
				</div>
			</div>
		</form>
	</div>
	<@_sysAuthorized roleIds=admin.roles urls='cmsContent/add,cmsContent/delete,cmsContent/check,cmsContent/push,cmsContent/refresh,cmsContent/publish,cmsContent/moveParameters'><#assign authorizedMap=map/></@_sysAuthorized>
	<div class="pageContent">
		<div class="panelBar">
			<ul class="toolBar">
				<#if parent?has_content>
					<li><a href="cmsContent/list.html?parentId=${(parent.parentId)!}&categoryId=${(parent.categoryId)!}" target="navTab" rel="cmsContent/list"><i class="icon-circle-arrow-up icon-large"></i> 返回上一级</a></li>
					<li class="line">line</li>
				</#if>
<#if authorizedMap['cmsContent/add']>
	<#if categoryId?has_content>
		<@_modelList parentId=(parent.modelId)!'' count=5>
			<#list page.list as a>
				<@_categoryModelList modelId=a.id categoryId=categoryId>
					<#if page.totalCount gt 0>
				<li><a href="cmsContent/add.html?categoryId=${(parent.categoryId)!categoryId!}&modelId=${a.id}&parentId=${parentId!}" target="navTab" rel="cmsContent/add"><i class="icon-plus-sign-alt icon-large"></i> 添加${(a.name)!}</a></li>
					</#if>
				</@_categoryModelList>
			</#list>
			<#if page.totalCount gt 5>
				<li><a href="cmsContent/addMore.html?categoryId=${(parent.categoryId)!categoryId!}" target="dialog" mask="true"><i class="icon-plus-sign icon-large"></i> 添加更多内容</a></li>
			</#if>
		</@_modelList>
	</#if>
				<li><a href="cmsContent/add.html?id={sid}" target="navTab" rel="cmsContent/edit"><i class="icon-edit icon-large"></i> 修改内容</a></li>
				<li class="line">line</li>
</#if>
			<#if authorizedMap['cmsContent/check']>
				<li><a href="cmsContent/check.do" title="确定要审核这些记录么?"  target="selectedTodo" rel="ids"><i class="icon-check icon-large"></i> 批量审核</a></li>
			</#if>
			<#if authorizedMap['cmsContent/refresh']>
				<li><a href="cmsContent/refresh.do" title="确定要刷新这些记录么?"  target="selectedTodo" rel="ids"><i class="icon-refresh icon-large"></i> 批量刷新</a></li>
			</#if>
			<#if authorizedMap['cmsContent/publish']>
				<li><a href="cmsContent/publish.do" title="确定要生成这些记录么?"  target="selectedTodo" rel="ids"><i class="icon-file-text-alt icon-large"></i> 批量生成</a></li>
			</#if>
			<#if authorizedMap['cmsContent/moveParameters']>
				<li><a href="cmsContent/moveParameters.html" target="dialog" mask="true"><i class="icon-move icon-large"></i> 批量移动</a></li>
			</#if>
			<#if authorizedMap['cmsContent/delete']>
				<li class="line">line</li>
				<li><a href="cmsContent/delete.do" title="确定要删除这些记录么?"  target="selectedTodo" rel="ids"><i class="icon-trash icon-large"></i> 批量删除</a></li>
			</#if>
			</ul>
		</div>
	<@_contentList advanced=true status=status categoryId=categoryId containChild=containChild
				modelId=modelId parentId=parentId emptyParent=true title=title userId=userId 
				startPublishDate=startPublishDate endPublishDate=endPublishDate 
				orderField=orderField orderType=orderType pageIndex=pageNum count=numPerPage>
		<table class="list" width="100%" layoutH="117">
			<thead>
				<tr>
					<th width="20"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
					<th width="30">ID</th>
					<th width="250">标题</th>
					<th width="40">发布</th>
					<th width="30">分类</th>
					<th width="30">模型</th>
					<th width="30" orderField="scores" class="<#if orderField??&&'scores'==orderField><#if 'asc'=orderType>asc<#else>desc</#if><#else>order</#if>">分数</th>
					<th width="30" orderField="comments" class="<#if orderField??&&'comments'==orderField><#if 'asc'=orderType>asc<#else>desc</#if><#else>order</#if>">评论数</th>
					<th width="30" orderField="clicks" class="<#if orderField??&&'clicks'==orderField><#if 'asc'=orderType>asc<#else>desc</#if><#else>order</#if>">点击数</th>
					<th width="70" orderField="publishDate" class="<#if orderField??&&'publishDate'==orderField><#if 'asc'=orderType>asc<#else>desc</#if><#else>order</#if>">发布日期</th>
					<th width="70">创建日期</th>
					<th width="50">状态/审核用户</th>
					<th width="100">操作</th>
				</tr>
			</thead>
			<tbody>
				<#list page.list as a>
					<@t.merge 'userIds' a.userId!/>
					<@t.merge 'checkUserIds' a.checkUserId!/>
					<@t.merge 'categoryIds' a.categoryId!/>
					<@t.merge 'modelIds' a.modelId!/>
				</#list>
				
				<@_sysUser ids=t.userIds!><#assign userMap=map!/></@_sysUser>
				<@_sysUser ids=t.checkUserIds!><#assign checkUserMap=map!/></@_sysUser>
				<@_category ids=t.categoryIds!><#assign categoryMap=map!/></@_category>
				<@_model ids=t.modelIds!><#assign modelMap=map!/></@_model>
				
				<#list page.list as a>
				<tr target="sid" rel="${a.id}">
					<td><input name="ids" value="${a.id}" type="checkbox"></td>
					<td>${a.id}</td>
					<td>${(a.copied?then('[转载]',''))!}<a href="${a.url!}" target="_blank">${a.title!}</a></td>
					<td>
						<a href="cmsContent/list.html?userId=${a.userId}" target="navTab" rel="cmsContent/list">
							${(userMap[a.userId?string].nickName)!}
						</a>
					</td>
					<td>
						<a href="cmsContent/list.html?categoryId=${a.categoryId}&parentId=${(parent.parentId)!}" target="navTab" rel="cmsContent/list">
							${(categoryMap[a.categoryId?string].name)!}
						</a>
					</td>
					<td>
						<a href="cmsContent/list.html?modelId=${a.modelId}&categoryId=${categoryId!}&parentId=${(parent.parentId)!}" target="navTab" rel="cmsContent/list">
							${(modelMap[a.modelId?string].name)!}
						</a>
					</td>
					<td>${a.scores!}</td>
					<td>${a.comments!}</td>
					<td>${a.clicks!}</td>
					<td>${a.publishDate!}</td>
					<td>${a.createDate!}</td>
					<td>
						<@t.m 'status.content.'+a.status/>
						<#if 1=a.status>/ ${(checkUserMap[a.checkUserId?string].nickName)!}</#if>
					</td>
					<td>
						<#if modelMap[a.modelId?string].hasChild>
							<a href="cmsContent/list.html?parentId=${a.id}&categoryId=${a.categoryId}" target="navTab" rel="cmsContent/list">子内容管理</a>
						</#if>
						<#if 1=a.status>
							<#if authorizedMap['cmsContent/push']>
								<a href="cmsContent/push.html?contentId=${a.id}" target="dialog" rel="push">推荐</a>
							</#if>
						<#elseif 2=a.status>
							<#if authorizedMap['cmsContent/check']>
								<a href="cmsContent/check.do?ids=${a.id}" title="确定要审核这条记录么?"  target="ajaxTodo">审核</a>
							</#if>
						</#if>
						<#if authorizedMap['cmsContent/add']>
							<a href="cmsContent/add.html?id=${a.id}" target="navTab" rel="cmsContent/edit" title="修改内容">修改</a>
						</#if>
						<#if authorizedMap['cmsContent/delete']>
							<a href="cmsContent/delete.do?ids=${a.id}" title="确定要删除这条记录么?"  target="ajaxTodo">删除</a>
						</#if>
					</td>
				</tr>
				</#list>
			</tbody>
		</table>
		<#include "../include_page/page.html"/>
	</@_contentList>
	</div>
</#if>